package com.crm.common.model;

import java.util.List;

import com.github.pagehelper.PageInfo;

public class DhPageInfo<T> {
	private List<T> list;
	private Integer pageIndex;
	private Integer pageSize;
	private Long totalRecords;
	private Integer totalPages;

	public DhPageInfo(PageInfo<?> pageinfo) {
		super();
		this.pageIndex = pageinfo.getPageNum();
		this.pageSize = pageinfo.getPageSize();
		this.totalRecords = pageinfo.getTotal();
		this.totalPages = pageinfo.getPages();
	}

	public DhPageInfo(PageInfo<?> pageinfo, List<T> list) {
		super();
		this.list = list;
		this.pageIndex = pageinfo.getPageNum();
		this.pageSize = pageinfo.getPageSize();
		this.totalRecords = pageinfo.getTotal();
		this.totalPages = pageinfo.getPages();
	}

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public Integer getPageIndex() {
		return pageIndex;
	}

	public void setPageIndex(Integer pageIndex) {
		this.pageIndex = pageIndex;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Long getTotalRecords() {
		return totalRecords;
	}

	public void setTotalRecords(Long totalRecords) {
		this.totalRecords = totalRecords;
	}

	public Integer getTotalPages() {
		return totalPages;
	}

	public void setTotalPages(Integer totalPages) {
		this.totalPages = totalPages;
	}

}
